package cur.nature.component.satoken.common.config;

import cn.dev33.satoken.log.SaLog;
import cur.nature.framework.core.log.LOG;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

/**
 * 将 Sa-Token log 信息转接到 Slf4j
 */
@Component
@ConditionalOnProperty( value = {"cur.component.satoken.enable"})
public class SaLogForSlf4j implements SaLog {

    @Override
    public void trace(String str, Object... args) {
        LOG.trace(str, args);
    }
    @Override
    public void debug(String str, Object... args) {
        LOG.debug(str, args);
    }
    @Override
    public void info(String str, Object... args) {
        LOG.info(str, args);
    }
    @Override
    public void warn(String str, Object... args) {
        LOG.warn(str, args);
    }
    @Override
    public void error(String str, Object... args) {
        LOG.error(str, args);
    }
    @Override
    public void fatal(String str, Object... args) {
        LOG.error(str, args);
    }
}

